<%@ Control Language="c#" %>
<%@ Register TagPrefix="CS" Namespace="CommunityServer.Controls" Assembly="CommunityServer.Controls" %>
<%@ Register TagPrefix="ComponentArt" Namespace="ComponentArt.Web.UI" Assembly="ComponentArt.Web.UI" %>
<%@ Register TagPrefix="CP" Namespace="CommunityServer.ControlPanel.Controls" Assembly="CommunityServer.Web" %>
<%@ Import Namespace = "CommunityServer.Components" %>

<script language="javascript">

joinedDateValue = new Date();
lastPostDateValue = new Date();
prevJoinedDateIndex = 0;
prevPostDateIndex = 0;

function disableJoinedDate(DropDownList) 
{
	if (DropDownList.selectedIndex == 0) {
		joinedDateValue = <%=this.joinedDate.ClientID %>.GetSelectedDate();
		<%=this.joinedDate.ClientID %>.ClearSelectedDate();
		document.forms[0].joinedDateCalendar_button.width = 0;
	}
	else {
		if (prevJoinedDateIndex == 0) {
			<%=this.joinedDate.ClientID %>.SetSelectedDate(joinedDateValue);
			document.forms[0].joinedDateCalendar_button.width = 25;
		}
		else {
			joinedDateValue = <%=this.joinedDate.ClientID %>.GetSelectedDate();
		}
	}
	prevJoinedDateIndex = DropDownList.selectedIndex;
}
function disableLastPostDate(DropDownList) 
{
	if (DropDownList.selectedIndex == 0) {
		lastPostDateValue = <%=this.lastPostDate.ClientID %>.GetSelectedDate();
		<%=this.lastPostDate.ClientID %>.ClearSelectedDate();
		document.forms[0].lastPostDateCalendar_button.width = 0;
	}
	else {
		if (prevPostDateIndex == 0) {
			<%=this.lastPostDate.ClientID %>.SetSelectedDate(lastPostDateValue);
			document.forms[0].lastPostDateCalendar_button.width = 25;
		}
		else {
			lastPostDateValue = <%=this.lastPostDate.ClientID %>.GetSelectedDate();
		}
	}
	prevPostDateIndex = DropDownList.selectedIndex;
}

function onJoinedPickerChange(picker)
{
	<%=this.joinedDateCalendar.ClientID %>.SetSelectedDate(picker.GetSelectedDate());
}
function onJoinedCalendarChange(calendar)
{
	<%=this.joinedDate.ClientID %>.SetSelectedDate(calendar.GetSelectedDate());
}

function onLastPostPickerChange(picker)
{
	<%=this.lastPostDateCalendar.ClientID %>.SetSelectedDate(picker.GetSelectedDate());
}
function onLastPostCalendarChange(calendar)
{
	<%=this.lastPostDate.ClientID %>.SetSelectedDate(calendar.GetSelectedDate());
}
</script>


<table border="0" cellpadding="2" cellspacing="0">
<tr>
	<td align="right" class="CommonFormFieldName">
		<cs:helpicon runat="Server" resourcename="UserSearchControl_Search_Desc" />
	</td>
	<td class="CommonFormField">
		<asp:textbox id="searchText" runat="server" Columns=75 lass="shorttxt" maxlength="255"></asp:textbox>
	</td>
	<td align="right" class="CommonFormFieldName">
		<asp:LinkButton id="searchButton" runat="server" cssclass="CommonTextButton" />
    </td>
</tr>
</table>

<p />

<fieldset>
    <legend><cs:resourcecontrol runat="server" resourcename="UserSearchControl_SortBy" id="Resourcecontrol14" /></legend>
    <table border="0" cellpadding="2" cellspacing="0">
        <tr>
	        <td colspan="3" class="CommonFormField">
		        <cs:membersortdropdownlist id="memberSortDropDown" runat="server" />
		        <cs:sortorderdropdownlist id="sortOrderDropDown" runat="server" />
	        </td>
        </tr>
    </table>
</fieldset>

<p />
<fieldset>
    <legend><cs:resourcecontrol ID="Resourcecontrol5" runat="server" resourcename="UserSearchControl_FilterByDate" /></legend>
    <table border="0" cellpadding="2" cellspacing="0">
        <tr>
	        <td align="right" class="CommonFormFieldName"><cs:resourcecontrol ID="Resourcecontrol2" runat="server" resourcename="UserSearchControl_JoinedDate" /></td>
	        <td class="CommonFormField" nowrap="true">
		        <asp:dropdownlist id="joinedDateComparer" runat="server" />
		        <componentart:calendar id="joinedDate" runat="server" pickerformat="Custom" pickercustomformat="MMMM d yyyy" controltype="Picker" pickercssclass="picker" clientsideonselectionchanged="onJoinedPickerChange"></componentart:calendar>
		        <img id="joinedDateCalendar_button" alt="" onclick="<%=this.joinedDateCalendar.ClientID %>.SetSelectedDate(<%=this.joinedDate.ClientID %>.GetSelectedDate());<%=this.joinedDateCalendar.ClientID %>.Show();" class="calendar_button" src="<%=SiteUrls.Instance().Locations["controlpanel"]%>images/caimages/btn_calendar.gif" width="25" height="22" />
		        <componentart:calendar runat="server"
			        id="joinedDateCalendar" 
			        allowmonthselection="true"
			        allowmultipleselection="false"
			        allowweekselection="true"
			        calendarcssclass="calendar" 
			        calendartitlecssclass="title" 
			        clientsideonselectionchanged="onJoinedCalendarChange" 
			        controltype="Calendar"
			        daycssclass="day" 
			        dayheadercssclass="dayheader" 
			        dayhovercssclass="dayhover" 
			        daynameformat="FirstTwoLetters"
			        monthcssclass="month"
			        nextprevcssclass="nextprev" 
			        othermonthdaycssclass="othermonthday" 
			        popup="Custom"
			        popupexpandcontrolid="joinedDateCalendar_button"
			        selecteddate="2005-9-14"
			        selecteddaycssclass="selectedday" 
			        selectmonthcssclass="selector"
			        selectmonthtext="&curren;" 
			        selectweekcssclass="selector"
			        selectweektext="&raquo;" 
			        swapduration="300"
			        swapslide="Linear"
			        />
	        </td>
	      </tr>
	      <tr>
	        <td align="right" class="CommonFormFieldName"><cs:resourcecontrol ID="Resourcecontrol3" runat="server" resourcename="UserSearchControl_LastPostDate" /></td>
	        <td class="CommonFormField" nowrap="true">
		        <asp:dropdownlist id="lastPostDateComparer" runat="server" />
		        <componentart:calendar id="lastPostDate" runat="server" pickerformat="Custom" pickercustomformat="MMMM d yyyy" controltype="Picker" pickercssclass="picker" clientsideonselectionchanged="onLastPostPickerChange"></componentart:calendar>
		        <img id="lastPostDateCalendar_button" alt="" onclick="<%=this.lastPostDateCalendar.ClientID %>.SetSelectedDate(<%=this.lastPostDate.ClientID %>.GetSelectedDate());<%=this.lastPostDateCalendar.ClientID %>.Show();" class="calendar_button" src="<%=SiteUrls.Instance().Locations["controlpanel"]%>images/caimages/btn_calendar.gif" width="25" height="22" />
		        <componentart:calendar runat="server"
			        id="lastPostDateCalendar" 
			        allowmonthselection="true"
			        allowmultipleselection="false"
			        allowweekselection="true"
			        calendarcssclass="calendar" 
			        calendartitlecssclass="title" 
			        clientsideonselectionchanged="onLastPostCalendarChange" 
			        controltype="Calendar"
			        daycssclass="day" 
			        dayheadercssclass="dayheader" 
			        dayhovercssclass="dayhover" 
			        daynameformat="FirstTwoLetters"
			        monthcssclass="month"
			        nextprevcssclass="nextprev" 
			        othermonthdaycssclass="othermonthday" 
			        popup="Custom"
			        popupexpandcontrolid="lastPostDateCalendar_button"
			        selecteddate="2005-9-14"
			        selecteddaycssclass="selectedday" 
			        selectmonthcssclass="selector"
			        selectmonthtext="&curren;" 
			        selectweekcssclass="selector"
			        selectweektext="&raquo;" 
			        swapduration="300"
			        swapslide="Linear"
			        />
	        </td>
        </tr>
    </table>
</fieldset>

<p />
<fieldset>
    <legend><cs:resourcecontrol ID="Resourcecontrol4" runat="server" resourcename="UserSearchControl_FilterBy" /></legend>
    <table border="0" cellpadding="2" cellspacing="0">
	    <tr>
	        <td align="right" class="CommonFormFieldName">
                <cs:resourcecontrol ID="Resourcecontrol1" runat="server" resourcename="UserSearchControl_Role" />
            </td>
	        <td class="CommonFormField">
	            <asp:dropdownlist id="searchRole" runat="server" />
	        </td>
	    </tr>
        <tr id="AdminRow1" runat="server">
	        <td align="right" class="CommonFormFieldName">
		        <cs:helpicon runat="Server" resourcename="UserSearchControl_SearchFor_Desc" />
		        <cs:resourcecontrol runat="server" resourcename="UserSearchControl_SearchFor" />
	        </td>
	        <td class="CommonFormField">
        		<asp:dropdownlist id="searchType" runat="server" align="absmiddle" />
	        </td>
	    </tr>
	    <tr>
	        <td align="right" class="CommonFormFieldName">
		        <cs:helpicon runat="Server" resourcename="UserSearchControl_Status_Desc" />
		        <cs:resourcecontrol runat="server" resourcename="UserSearchControl_Status" />
	        </td>
        	<td class="CommonFormField"><cs:accountstatusdropdownlist enableshowall = "true" id="currentAccountStatus" runat="server" /></td>
        </tr>
    </table>
</fieldset>